Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api_nearest_endpoints_return_node_list_in_reverse_order_#905 #935

Conversation

apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Mar 15, 2023

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • manual test with insomnia

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@apoorv-2204 apoorv-2204 self-assigned this Mar 15, 2023
@apoorv-2204 apoorv-2204 marked this pull request as ready for review March 15, 2023 05:02
@samuelmanzanera samuelmanzanera linked an issue Mar 15, 2023 that may be closed by this pull request
Copy link
Member

@bchamagne bchamagne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I test with a cURL:

ipv4

curl 'http://localhost:4000/api/graphiql' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: http://localhost:4000/api/graphiql' -H 'content-type: application/json' -H 'Origin: http://localhost:4000' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Cookie: _archethic_key=SFMyNTY.g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYWUJEVDRmUUd3MG9NSTZQenZxdm9NSjI0.wpaSgNzTOZ0tiQb2yr7BGu27xBXo3IyhH44_UQshr1I' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"query":"query {\n  nearestEndpoints{\n    ip, port\n  }\n}","variables":null}' -H 'x-forwarded-for: 192.168.10.1,192.168.1.2'

ipv6

curl 'http://localhost:4000/api/graphiql' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: http://localhost:4000/api/graphiql' -H 'content-type: application/json' -H 'Origin: http://localhost:4000' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Cookie: _archethic_key=SFMyNTY.g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYWUJEVDRmUUd3MG9NSTZQenZxdm9NSjI0.wpaSgNzTOZ0tiQb2yr7BGu27xBXo3IyhH44_UQshr1I' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"query":"query {\n  nearestEndpoints{\n    ip, port\n  }\n}","variables":null}' -H 'x-forwarded-for: 2001:db8:85a3:8d3:1319:8a2e:370:7348'

and remote_ip was set as expected.

@samuelmanzanera samuelmanzanera merged commit 790de1c into archethic-foundation:develop Mar 17, 2023
@samuelmanzanera samuelmanzanera added the bug Something isn't working label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done 🍻
Development

Successfully merging this pull request may close these issues.

API nearest endpoints return node list in reverse order
3 participants